#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Niklas Hauser
#
# This file is part of the modm project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# -----------------------------------------------------------------------------

def init(module):
    module.name = ":ui:display"
    module.description = """\
# Display Graphics

Code for writing and drawing on character and graphical displays.

## Coordinate System

```
(0, 0)
   +---------------------+
   |  ----> X            |
   | |                   |
   | |                   |
   | V Y                 |
   |                     |
   |                     |
   |                     |
   +---------------------+
               e.g. (127, 63)
```

The size (width and height) of a graphics primitive always correspond
to its mathematical model, ignoring the rendered with. As everything
is drawn one pixel wide, the pixels will be rendered to the right and
below the mathematically defined points.
"""

def prepare(module, options):
    module.depends(
        ":architecture:accessor",
        ":io",
        ":math:geometry",
        ":math:utils",
        ":ui:color")
    return True

def build(env):
    env.outbasepath = "modm/src/modm/ui/display"
    env.copy(".", ignore=env.ignore_files("*.font", "*.pbm"))
    env.copy("../display.hpp")
